******************************
*Ryan Thombs
*LEED Schools SPI and Discipline 
******************************

*Clear the system
capture log close
clear
set more off

use E:\LEED.dta 


describe
sum
sum if Treatment==0
sum if Treatment==1
ttest SPI, by (Treatment) 
ttest PercentEconDis, by (Treatment)
ttest Attendance, by (Treatment)
ttest Enrollment, by (Treatment)
ttest Female, by (Treatment)
ttest Black, by (Treatment)
ttest White, by (Treatment)
ttest Hispanic, by (Treatment)
ttest PerPupilExpenditureClassroom, by (Treatment)
ttest MedianTeacherSalary, by (Treatment)
ttest StudentsperTeacherFTEEnroll, by (Treatment)

******Skewness******
swilk SPI PercentEconDis Attendance Enrollment Female Black White Hispanic PerPupilExpenditureClassroom MedianTeacherSalary StudentsperTeacherFTEEnroll
gen lnSPI= ln(SPI)
gen lnecon= ln(PercentEconDis)
gen lnatt= ln(Attendance)
gen lnenroll= ln(Enrollment)
gen lnF= ln(Female)
gen lnexp= ln(PerPupilExpenditureClassroom)
gen lnsalary= ln(MedianTeacherSalary)
gen lnStuTeach= ln(StudentsperTeacherFTEEnroll)


****Analysis***
xtset school Year, yearly
xtreg lnSPI lnF lnexp lnStuTeach i.LEED##i.Treatment, robust cluster (school)
xtreg lnSPI lnF lnexp lnStuTeach lnecon lnenroll Black Hispanic lnsalary lnatt i.LEED##i.Treatment,robust cluster(School)
xtreg lnSPI lnF lnexp lnStuTeach i.LEED##i.Treatment,robust cluster(School)

gen placebo= 1 if Year>=2013
replace placebo=0 if Year<2013
xtreg lnSPI lnF lnexp lnStuTeach i.placebo##i.Treatment,robust cluster(school)
xtreg lnSPI lnF lnexp lnStuTeach lnecon lnenroll Black Hispanic lnsalary lnatt i.placebo##i.Treatment,robust cluster(school)
gen p2= 1 if Year>=2010 
replace p2= 0 if Year<2010
xtreg lnSPI lnF lnexp lnStuTeach i.p2##i.Treatment,robust cluster(school)
xtreg lnSPI lnF lnexp lnStuTeach lnecon lnenroll Black Hispanic lnsalary lnatt i.p2##i.Treatment,robust cluster(school)
gen p3= 1 if Year>=2011
replace p3=0 if Year<2011
xtreg lnSPI lnF lnexp lnStuTeach i.p3##i.Treatment,robust cluster(school)
xtreg lnSPI lnF lnexp lnStuTeach lnecon lnenroll Black Hispanic lnsalary lnatt i.p3##i.Treatment,robust cluster(school)
graph twoway (lfit SPI Year if Treatment==1)(lfit SPI Year if Treatment==0), xline (2012)



